﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IArgument.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Provides argument evaluation functionality.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Windows.Input
{
    using System;
    using System.Windows.Interactivity;

    /// <summary>
    /// Provides argument evaluation functionality.
    /// </summary>
    public interface IArgument : IAttachedObject
    {
        /// <summary>
        /// Evaluates the argument in the specified <paramref name="context"/>.
        /// </summary>
        /// <param name="context">The context used to evaluate the argument.</param>
        /// <returns>The value of the argument.</returns>
        /// <remarks>When invoked via <see cref="TriggerBase"/> the context argument is the context of the tigger, for example when working with event triggers the context 
        /// is the <see cref="EventArgs"/> of the event that raised the trigger.</remarks>
        object Evaluate(object context);

        /// <summary>
        /// Occurs when changes are detected that could indicate the arguments value has changed.
        /// </summary>
        event EventHandler RequerySuggested;
    }
}
